//
//	ZcoModelFormBrief.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "ZcoModelFormBrief.h"

NSString *const kZcoModelFormBriefFollowId = @"followId";
NSString *const kZcoModelFormBriefFormId = @"formId";
NSString *const kZcoModelFormBriefFormName = @"formName";
NSString *const kZcoModelFormBriefFormTemplate = @"formTemplate";
NSString *const kZcoModelFormBriefFrom = @"from";
NSString *const kZcoModelFormBriefTo = @"to";

@interface ZcoModelFormBrief ()
@end
@implementation ZcoModelFormBrief




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kZcoModelFormBriefFollowId] isKindOfClass:[NSNull class]]){
		self.followId = dictionary[kZcoModelFormBriefFollowId];
	}	
	if(![dictionary[kZcoModelFormBriefFormId] isKindOfClass:[NSNull class]]){
		self.formId = [dictionary[kZcoModelFormBriefFormId] integerValue];
	}

	if(![dictionary[kZcoModelFormBriefFormName] isKindOfClass:[NSNull class]]){
		self.formName = dictionary[kZcoModelFormBriefFormName];
	}	
	if(![dictionary[kZcoModelFormBriefFormTemplate] isKindOfClass:[NSNull class]]){
		self.formTemplate = [dictionary[kZcoModelFormBriefFormTemplate] integerValue];
	}

	if(![dictionary[kZcoModelFormBriefFrom] isKindOfClass:[NSNull class]]){
		self.from = dictionary[kZcoModelFormBriefFrom];
	}	
	if(![dictionary[kZcoModelFormBriefTo] isKindOfClass:[NSNull class]]){
		self.to = dictionary[kZcoModelFormBriefTo];
	}	
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.followId != nil){
		dictionary[kZcoModelFormBriefFollowId] = self.followId;
	}
	dictionary[kZcoModelFormBriefFormId] = @(self.formId);
	if(self.formName != nil){
		dictionary[kZcoModelFormBriefFormName] = self.formName;
	}
	dictionary[kZcoModelFormBriefFormTemplate] = @(self.formTemplate);
	if(self.from != nil){
		dictionary[kZcoModelFormBriefFrom] = self.from;
	}
	if(self.to != nil){
		dictionary[kZcoModelFormBriefTo] = self.to;
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.followId != nil){
		[aCoder encodeObject:self.followId forKey:kZcoModelFormBriefFollowId];
	}
	[aCoder encodeObject:@(self.formId) forKey:kZcoModelFormBriefFormId];	if(self.formName != nil){
		[aCoder encodeObject:self.formName forKey:kZcoModelFormBriefFormName];
	}
	[aCoder encodeObject:@(self.formTemplate) forKey:kZcoModelFormBriefFormTemplate];	if(self.from != nil){
		[aCoder encodeObject:self.from forKey:kZcoModelFormBriefFrom];
	}
	if(self.to != nil){
		[aCoder encodeObject:self.to forKey:kZcoModelFormBriefTo];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.followId = [aDecoder decodeObjectForKey:kZcoModelFormBriefFollowId];
	self.formId = [[aDecoder decodeObjectForKey:kZcoModelFormBriefFormId] integerValue];
	self.formName = [aDecoder decodeObjectForKey:kZcoModelFormBriefFormName];
	self.formTemplate = [[aDecoder decodeObjectForKey:kZcoModelFormBriefFormTemplate] integerValue];
	self.from = [aDecoder decodeObjectForKey:kZcoModelFormBriefFrom];
	self.to = [aDecoder decodeObjectForKey:kZcoModelFormBriefTo];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	ZcoModelFormBrief *copy = [ZcoModelFormBrief new];

	copy.followId = [self.followId copy];
	copy.formId = self.formId;
	copy.formName = [self.formName copy];
	copy.formTemplate = self.formTemplate;
	copy.from = [self.from copy];
	copy.to = [self.to copy];

	return copy;
}
@end